<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>素材中心</title>
	<link rel="stylesheet" href="/layui/css/layui.css">
	<link rel="stylesheet" href="/hyqcss/public.css">
	<style type="text/css">
		body{
			background: #e9e9e9;
		}
		/*公共头部带搜索*/
		.public_container{
			margin: 20px;
			background: #fff;
		}
		.public_title_container{
			height: 54px;
			padding: 0 20px;
			font-size: 14px;
			display: flex;
			align-items: center;
			background: #f9f9f9;
			border-bottom: 1px solid #f0f0f0;
		}
		.public_title_container a{
			margin-right: 30px;
			height: 54px;
			line-height: 54px;
			cursor: pointer;
		}
		.public_title_active{
			color: #1E9FFF;
			border-bottom: 1px solid #1E9FFF;
		}
		.public_content{
			padding: 20px 0;
		}
	</style>
</head>
<body>
	<form class="layui-form" id="form1">
	<div class="public_container">
		<div class="public_title_container">
			<a href="index.html">短信模板列表</a>
			<a href="aliyun_config.html" class="public_title_active">阿里云配置</a>
		</div>
		<div class="public_content">
		    <div class="layui-form-item">
			    <label class="layui-form-label" style="width: 100px;">AccessKeyId</label>
			    <div class="layui-input-block">
			        <input type="text" name="acceskeyId" value="{$config->aliyun_acceskey_id}" required  lay-verify="required" placeholder="请输入AccessKeyId" autocomplete="off" class="layui-input" style="width: 15%;">
		    	</div>
		    </div>
		  	<div class="layui-form-item">
			    <label class="layui-form-label" style="width: 100px;">AccessKeySecret</label>
			    <div class="layui-input-block">
			        <input type="text" name="accesskeySecret" value="{$config->aliyun_acceskey_secret}" required  lay-verify="required" placeholder="请输入AccessKeySecret" autocomplete="off" class="layui-input" style="width: 15%;">
		    	</div>
		    </div>
		    <div class="layui-form-item">
		    	<label class="layui-form-label" style="width: 100px;"></label>
			    <div class="layui-input-block">
			      <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
			      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
			    </div>
		    </div>
		</div>
	</div>

	</form>
	<script src="/cdn/jquery.js"></script>
	<script src="/layui/layui.js"></script>
	<script src="/js/ajax.js"></script>
	<script type="text/javascript">
		layui.use('form', function(){
		  var form = layui.form;
		  	
		  //监听提交
		  form.on('submit(formDemo)', function(data){
		    // layer.msg(JSON.stringify(data.field));
		    var formData = $('#form1').serialize();	
			myAjaxPost(false, true, 'aliyun_config.html', formData, function (resp) {
				console.log(resp);
				console.log(resp.status);
				if (resp.status == 'success') {
					layer.msg(resp.msg);
					setTimeout(function(){
						location.reload(); 
					},1000);
				}else{
					alert(resp.msg);
				}
			});
		    return false;
		  });
		});
	</script>
</body>
</html>